﻿using System;
namespace MUD.Lib.Objects.Users
{
    [Flags]
    public enum Permissions
    {
        Guest = 0,
        Player = 2,
        FactionLeader = 4,
        Professional = 8,
        GameMaster = 2048,
        Admin = 4096
    }

    public static class PermissionsUtilities
    {
        public static bool Contains(this Permissions container, Permissions permSet)
        {
            return (container & permSet) == permSet;
        }

        public static Permissions Add(this Permissions container, Permissions permSet)
        {
            container = container | permSet;
            return container | permSet;
        }

        public static Permissions Remove(this Permissions container, Permissions permSet)
        {
            container = container & permSet;
            return container & permSet;
        }
    }
}